﻿using Newtonsoft.Json;

namespace DalamudManager.Models
{
    public class PluginInfo
    {
        public bool IsDisable { get; set; } = false;
        public string Path { get; set; } = null;

        public string Name { get; init; }
        public string Author { get; init; }
        public string Description { get; init; }
        public string[] Tags { get; init; }
        public string InternalName { get; init; }
        public string AssemblyVersion { get; init; }
        public string ApplicableVersion { get; init; }
        public int DalamudApiLevel { get; init; } = 1;
        public string RepoUrl { get; init; }

        public PluginInfo() { }

        public static PluginInfo Parse(string info)
            => JsonConvert.DeserializeObject<PluginInfo>(info);

        public override string ToString()
            => "Name: " + Name + "\nAuthor: " + Author + "\nDescription: " + Description;
    }
}
